class Storage {
    setStorage(name: any , data: any){
        try {
            localStorage.setItem(name, data)
        } catch (err) {
            console.log(err);
        }
    }
    //从本地缓存中读取置顶name对应的内容
	getCache(name: any) {
		try {
			return localStorage.getItem(name);
		} catch (e) {
			console.log(e);
		}
	}

	//从本地缓存中移出指定key
	removeCache(name: any) {
		try {
			localStorage.removeItem(name)
		} catch (e) {

			console.log(e);
		}
	}
    //清除本地数据缓存
	clearCache(){
		try{
			localStorage.clear()
		}catch(e){
			console.log(e)
		}
	}
}

export default new Storage()